function NewRequestAssistant(argFromPusher) {
	if(argFromPusher)
		this.form = argFromPusher.form;
}

NewRequestAssistant.prototype = {
	form: null,
	setup: function() {
		Ares.setupSceneAssistant(this);
		this.$.severityLs.setChoices(requestSeverities);
		this.m_duedate.date = new Date();
		this.controller.modelChanged(this.m_duedate);
		this.$.emailBox.setValue(user.mail);
		if(addr = getStorageObject("address" + user.uid))
			this.$.phoneBox.setValue(addr.phone);
		
		if(this.form){
			var this1 = this;
			Object.keys(this.form).each(function(key){
				this1.$[key].setValue(this1.form[key]);
			});
		}
	},
	cleanup: function() {
		Ares.cleanupSceneAssistant(this);
	},
	button1Tap: function(inSender, event) {
		var message = this.validate();
		if(message != ""){
			myAlert(this, message)
			return;
		}
		var request = {
			uid : user.uid,
			tids : this.$.catyLs.getValue()==2 ? [126,180,125] : [33,179,125],
			prodVersion : this.$.prodVersionBox.getValue(),
			severity : this.$.severityLs.getValue(),
			duedate : this.m_duedate.date.format("yyyy-MM-ddT16:00:00"),
			email : this.$.emailBox.getValue(),
			phone : this.$.phoneBox.getValue(),
			title : this.$.titleBox.getValue(),
			desc : this.$.descBox.getValue()
		};
		drupalService('uc_order.request', {request: request}, this, function(data) {
			myAlert(this, data, function(){
				Mojo.Controller.stageController.popScenesTo("home");
			});
		}.bind(this));
	},
	
	validate: function() {
		var invalidFields = [];
		if(! this.$.catyLs.getValue())
			invalidFields.push("Catagory");
		if(this.$.prodVersionBox.getValue().trim() == "")
			invalidFields.push("Pruduct Version");
		if(! this.$.severityLs.getValue())
			invalidFields.push("Severity");
		if(! this.m_duedate.date)
			invalidFields.push("Due Date");
		if(this.$.emailBox.getValue().trim() == "")
			invalidFields.push("Email");
		if(this.$.phoneBox.getValue().trim() == "")
			invalidFields.push("Phone");
		if(this.$.titleBox.getValue().trim() == "")
			invalidFields.push("Title");
		if(this.$.descBox.getValue().trim() == "")
			invalidFields.push("Description");
		
		if(invalidFields.length == 0) return "";
		else
			return "Please fill " + invalidFields.join(", ");
	}
};